import { addNewsList } from "../Blocks/News/newsList";
import { addNewsListDisorder } from "../Blocks/News/newsListDisorder";
import { addImageList } from "../Blocks/News/newsImageTextList";

export const NewsBlockManager = (editor) => {
  // 有序列表
  const optsOrder = {
    id: "news-list",
    label: "News List",
    classPrefix: "news-list",
    style: "",
    styleAdditional: "",
  };
  addNewsList(editor, optsOrder);
  editor.BlockManager.add("news-list", {
    media: `<svg viewBox="0 0 24 24"><path d="M3 6h18v2H3zM3 10h18v2H3zM3 14h18v2H3zM3 18h18v2H3z"/></svg>`,
    label: "新闻列表",
    category: "新闻类",
    select: true,
    content: { type: "news-list" },
  });

  // 无序列表
  const optsDisorder = {
    id: "news-list-disorder",
    label: "News List Disorder",
    classPrefix: "news-list-disorder",
    style: "",
    styleAdditional: "",
  };
  addNewsListDisorder(editor, optsDisorder);
  editor.BlockManager.add("news-list-disorder", {
    label: "新闻无序列表",
    category: "新闻类",
    select: true,
    content: { type: "news-list-disorder" },
  });

  // 图文混排
  const optsImage = {
    id: "image-text-list",
    label: "Image Text List",
    classPrefix: "image-text-list",
    style: "",
    styleAdditional: "",
  };
  addImageList(editor, optsImage);
  editor.BlockManager.add("image-text-list", {
    label: "图文混排列表",
    category: "新闻类",
    select: true,
    content: { type: "image-text-list" },
  });
};
